const { Sequelize, Model, INTEGER } = require('sequelize')
const { db } = require('../core/sequelize')
class Category extends Model {
    static async getCategoryList() {
        // where查询
        const categoryList = await Category.findAll()
        return categoryList
    }
}
Category.init(
    {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true, //设置主键
            autoIncrement: true,
        },
        name: Sequelize.STRING, //类型 字符串
        urlname: Sequelize.STRING, //类型 字符串
        col: Sequelize.INTEGER, //类型 字符串
    },
    {
        // underscored: true,
        sequelize: db,
        modelName: 'category', timestamps: false
    }
)

Category.associate = function () {



}
module.exports = { Category }
